package com.modifiertech.lineage.api;

import net.minecraft.entity.player.EntityPlayer;

import java.util.Objects;

public class LineageAPI {
    private static LineageAPI instance;
    private LineageModAccess modAccess;

    public LineageAPI(LineageModAccess modAccess){
        this.modAccess=modAccess;
    }



    public static LineageAPI getInstance(){
        return Objects.requireNonNull(instance,"Calling Lineage API Instance before it's creation");
    }
    public static void setInstance(LineageAPI reskillableAPI) {
        instance = reskillableAPI;
    }


    /**与服务端同步玩家数据信息
     *
     * @param entityPlayer
     * @param playerData
     */
    public void syncPlayerData(EntityPlayer entityPlayer, PlayerData playerData) {
        modAccess.syncPlayerData(entityPlayer, playerData);
    }


}
